package org.dei.perla.aggregates;

import java.util.ArrayList;

//import org.dei.perla.sys.query.llqruntime.datastructures.Buffer;
//import org.dei.perla.aggregates.MngAggregate.BufferReader;
import org.dei.perla.parser.clauses.LLEveryClause;
import org.dei.perla.parser.clauses.LLEveryEventBased;
import org.dei.perla.parser.clauses.LLEveryTimeBased;
import org.dei.perla.parser.datastructures.Field;
import org.dei.perla.parser.expressions.AggregationType;
import org.dei.perla.parser.expressions.ConstantCastException;
import org.dei.perla.parser.expressions.ConstantFloat;
import org.dei.perla.parser.expressions.ConstantID;
import org.dei.perla.parser.expressions.ConstantInteger;
import org.dei.perla.parser.expressions.ConstantTimestamp;
import org.dei.perla.parser.expressions.NodeAggregation;
import org.dei.perla.parser.statements.LLStatement;
import org.dei.perla.parser.util.Duration;
import org.dei.perla.parser.util.TimeUnit;
import org.dei.perla.sys.query.llqruntime.datastructures.QueryRecordStructure;
import org.dei.perla.sys.query.llqruntime.datastructures.Record;
import org.dei.perla.utils.waiter.Waitable;

public class FakeController {
	public static void main (String args[]) {
		Buffer			pBuffer;
		LLEveryClause	tLLClause;
		Field			field;
		AggregationType aggregationType;
		
		pBuffer = new Buffer();
		// Event based
		tLLClause = new LLEveryEventBased();
		((LLEveryEventBased)tLLClause).setSamples(5);
	
		// Time based
//		tLLClause = new LLEveryTimeBased();
//		((LLEveryTimeBased)tLLClause).setInterval(new Duration(10000, TimeUnit.MILLISECONDS));
		
		//Type of operation to perform
		aggregationType = AggregationType.AVG;
		AggregationOperator ao = new SampleMean();
		field = new Field();
		field.setName("temp");;
		
		(new Thread(new ThreadWriteBuffer(pBuffer))).start();
		DataAggregator da = new DataAggregator(pBuffer, ao, tLLClause, field);
	}
}

